Skip to content

list: render as a single chronological timeline (Phase B) - #30

Merged
rn404 merged 5 commits into
mainfrom
memo-log-redesign-phase-b
Aug 8, 2026
Merged

list: render as a single chronological timeline (Phase B)#30
rn404 merged 5 commits into
mainfrom
memo-log-redesign-phase-b

Conversation

@rn404

@rn404 rn404 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • list's default view moves from separate Task/Memo sections to one chronological timeline: log.Timeline merges and sorts every item, each line leads with its creation time and a marker ( for a memo, [ ]/[x]/[>] for a task), with hash and tags trailing in parens.
  • Hardens two bugs a code review found: Split/Timeline now sort with sort.SliceStable (deterministic tie-break for same-millisecond items), and the test helper openTaskHashes no longer mismatches on task content containing "[ ]" or literal parentheses.
  • Extracts the memo/open/started/closed precedence into model.Item.Status() so view.Timeline maps status to marker with a flat switch instead of re-deriving it inline.

Test plan

  • gofmt -l . clean
  • go vet ./... clean
  • go build ./...
  • go test ./... -count=1 (all 7 packages pass)
  • Regression tests added for each review fix, each verified to fail against the pre-fix code before the fix was applied

rn404 added 5 commits August 8, 2026 17:56
Resolve two ambiguities in the Phase B mockup before implementing:
memo lines keep their hash/tags (del/tag need it, so omitting it
would just force a separate list lookup), and the "Today's logs
are..." header stays for consistency with every other list mode.
list's default view moves from Task/Memo sections to one
chronological list (log.Timeline merges and sorts both, replacing
the split-then-render path for this case). Each line now leads with
its creation time and a marker ("・" for a memo, "[ ]"/"[x]"/"[>]"
for a task), with the hash and tags trailing in parens — memos keep
their hash since del/tag still need it. view.ItemList is removed;
Timeline is its only remaining caller. -t tag filtering and all other
list modes (-a, -s, a specific date) are unaffected.
- Split/Timeline: sort.Slice -> sort.SliceStable so items sharing the
  same millisecond CreatedAt keep a deterministic order instead of an
  unspecified one.
- openTaskHashes: match the "[ ]" marker only at its fixed position
  and read the hash from the last parenthesized group, so item
  content containing "[ ]" or literal parentheses no longer produces
  a false match.

Found in Phase B code review; findings 4-6 from the same review are
documented in docs/reports/2026-08-08-phase-b-code-review.md and left
open for Phase C.
Add model.Item.Status(), giving Closed precedence over Started, so
the memo/open/started/closed precedence lives with the data instead
of being re-derived inline in view.Timeline. view.Timeline now maps
Status() to a marker with a flat switch instead of an if-guarded one.

Addresses findings 5-6 from the Phase B code review (already
documented as deferred in docs/reports/2026-08-08-phase-b-code-review.md,
now updated to reflect the fix).
- openTaskHashes: rename open/close locals so they don't shadow the
  close builtin.
- model.go: add a doc comment on the Status const block so exported
  constants aren't flagged as undocumented.
@rn404
rn404 merged commit d9315ad into main Aug 8, 2026
2 checks passed
@rn404
rn404 deleted the memo-log-redesign-phase-b branch August 8, 2026 15:12
@github-actions github-actions Bot mentioned this pull request Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant